From dce4003c20bfd0a5100bd60dc0e923277b89684b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 7 Jun 2016 16:35:06 -0400 Subject: [PATCH] Fix preconditions in set_max_content_size setters We must allow resetting the properties to -1. --- gtk/gtkscrolledwindow.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 1fbf189c75..0534c9378f 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -4488,7 +4488,7 @@ gtk_scrolled_window_set_min_content_width (GtkScrolledWindow *scrolled_window, priv = scrolled_window->priv; - g_return_if_fail (priv->max_content_width == -1 || width <= priv->max_content_width); + g_return_if_fail (width == -1 || priv->max_content_width == -1 || width <= priv->max_content_width); if (priv->min_content_width != width) { @@ -4542,7 +4542,7 @@ gtk_scrolled_window_set_min_content_height (GtkScrolledWindow *scrolled_window, priv = scrolled_window->priv; - g_return_if_fail (priv->max_content_height == -1 || height <= priv->max_content_height); + g_return_if_fail (height == -1 || priv->max_content_height == -1 || height <= priv->max_content_height); if (priv->min_content_height != height) { @@ -4626,7 +4626,7 @@ gtk_scrolled_window_set_max_content_width (GtkScrolledWindow *scrolled_window, priv = scrolled_window->priv; - g_return_if_fail (priv->min_content_width == -1 || width >= priv->min_content_width); + g_return_if_fail (width == -1 || priv->min_content_width == -1 || width >= priv->min_content_width); if (width != priv->max_content_width) { @@ -4678,7 +4678,7 @@ gtk_scrolled_window_set_max_content_height (GtkScrolledWindow *scrolled_window, priv = scrolled_window->priv; - g_return_if_fail (priv->min_content_height == -1 || height >= priv->min_content_height); + g_return_if_fail (height == -1 || priv->min_content_height == -1 || height >= priv->min_content_height); if (height != priv->max_content_height) { -- 2.30.2